//
//  shipinTableViewCell.m
//  hainingOASystem
//
//  Created by michael on 2017/11/20.
//  Copyright © 2017年 czd. All rights reserved.
//

#import "shipinTableViewCell.h"

@implementation shipinTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {

 _label1 = [[UILabel alloc]init];
    _label1.frame = CGRectZero;
        _label1.numberOfLines = 0;
      [_label1 setFont:[UIFont systemFontOfSize:14]];
       [self.contentView addSubview:_label1];
    
       _label2 = [[UILabel alloc]init];
    _label2.frame = CGRectZero;
    _label2.numberOfLines = 0;
      [_label2 setFont:[UIFont systemFontOfSize:14]];
       [self.contentView addSubview:_label2];
    
       _label3 = [[UILabel alloc]init];
    _label3.frame = CGRectZero;
      [_label3 setFont:[UIFont systemFontOfSize:12]];
       [self.contentView addSubview:_label3];
    
 _label4 = [[UILabel alloc]init];
    _label4.frame = CGRectZero;
      [_label4 setFont:[UIFont systemFontOfSize:12]];
       [self.contentView addSubview:_label4];
_image = [[UIImageView alloc]init];
_image.frame = CGRectZero;
       [self.contentView addSubview:_image];

}

return self;

}
- (void)layoutSubviews{
[super layoutSubviews];

_image.frame  = CGRectMake(10, 10, 100, 100);
NSString *url = [NSString stringWithFormat:@"%@%@",kip,_dic[@"defaultPicUrl"]];
UIImage *image = [httpTool getThumbnailImage:url ];
    [self.image sd_setImageWithURL:[NSURL URLWithString:url] placeholderImage:[UIImage imageNamed:@"shipinpic.jpg"]];
//self.image.image = image;
_label2.frame =CGRectMake(_image.right+10, _image.top,KScreenWidth-100-20-10, 60);
_label2.textColor = [UIColor blackColor];//其中textColor要用UIColor类型
_label2.text = _dic[@"title"];
_label3.frame =CGRectMake(_image.right+10, _label2.bottom, _label2.width, 20);
_label3.textColor = [UIColor grayColor];//其中textColor要用UIColor类型
_label3.text = [NSString stringWithFormat:@"%@",_dic[@"updateTime"]];

}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
